<template>
  <div>
  <myback></myback>
    <a-input class="a1" v-model="username" placeholder="请输入用户名">
      <a-icon slot="prefix" type="user"/>
    </a-input>
    <a-input class="a1" v-model="new_username" placeholder="请输入新的用户名"/>
    <br>
    <a-button type="primary" @click="news">
      修改
    </a-button>
  </div>
</template>

<script>
import axios from 'axios'
import myback from './myback'
export default {
  data() {
    return {
      username: "",
      new_username:'',
    }
  }, 
  components:{
        'myback':myback
  },
  methods: {
      news(){
          axios({
              url:'http://127.0.0.1:8000/cel/',
              method:'post',
              data:{'username':this.username,'new_username':this.new_username}
          }).then(res =>{
              console.log(res.data)
              alert(res.data)
          })
      }
  }
}
</script>
<style>
.a1 {
  width: 60%;
  line-height: 50px;
}
</style>